//
//  BIDPayMethodCell.m
//  HJGJCommunity
//
//  Created by mal on 2017/5/31.
//  Copyright © 2017年 mal. All rights reserved.
//

#import "BIDPayMethodCell.h"

@interface BIDPayMethodCell()
{
    BOOL _isSelect;
}
@end

@implementation BIDPayMethodCell
@synthesize methodImgView;
@synthesize titleLabel;
@synthesize radioImgView;
@synthesize delegate;
@synthesize index;

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)btnDownHandler:(id)sender
{
    if(_isSelect)
    {}
    else
    {
        _isSelect = YES;
        [radioImgView setImage:[UIImage imageNamed:@"radio_choose.png"]];
        [delegate selectPayMethodAtIndex:index];
    }
}

- (void)updateSelectState:(BOOL)isSelect
{
    NSString *imgName = @"";
    _isSelect = isSelect;
    if(!isSelect)
    {
        imgName = @"radio_inchoose.png";
    }
    else
    {
        imgName = @"radio_choose.png";
    }
    [radioImgView setImage:[UIImage imageNamed:imgName]];
}

@end
